/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package back;

import core.Activity;
import dao.IActivity;
import java.io.Serializable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author Dominik
 */
@ManagedBean(name = "activity")
@SessionScoped
public class ActivityBean implements Serializable {

    @EJB 
    IActivity a;

    public ActivityBean() {
    }

    public List<Activity> getAllActivities() {
      Activity[] act = a.findAllActivities().toArray(new Activity[0]);
      List<Activity> acts = new LinkedList<Activity>();
      for(int i = act.length-1; i>=0; i--) acts.add(act[i]);
      return acts;
    }

}
